/*
2021-8-13
https://www.acwing.com/problem/content/302/
*/
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
int sumt[5010],sumc[5010];
int f[5010];

int main()
{
    int n,s;
    cin>>n>>s;
    
    for(int i=1;i<=n;i++)
    {
        cin>>sumt[i]>>sumc[i];
        sumt[i]+=sumt[i-1];
        sumc[i]+=sumc[i-1];
    }
    
    memset(f,0x3f,sizeof f);
    f[0]=0;
    
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<i;j++)
            f[i]=min(f[i],f[j]+sumt[i]*(sumc[i]-sumc[j])+s*(sumc[n]-sumc[j]));
    }
    
    cout<<f[n]<<endl;
    
    return 0;
}
